package com.wbs.shop.nuby.bean;

import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.AbsoluteSizeSpan;

import com.wbs.shop.nuby.R;

import java.math.BigDecimal;

/**
 * Created by zhoucl on 2018/6/14 0014.
 */
public class GoodsShowBean extends BaseBean implements Parcelable {
    private int id;
    private Integer specId;
    private String name;//名
    private String bottomName;//名
    private String price;//价格
    private String imgUrl;//图片
    private int quantity = 0;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Integer getSpecId() {
        return specId;
    }

    public void setSpecId(Integer specId) {
        this.specId = specId;
    }

    public String getBottomName() {
        return bottomName == null ? "" : bottomName;
    }

    public void setBottomName(String bottomName) {
        this.bottomName = bottomName;
    }

    public String getName() {
        return name == null ? "" : name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getImgUrl() {
        return imgUrl == null ? "" : imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public GoodsShowBean copy() {
        GoodsShowBean goodsShowBean = new GoodsShowBean();
        goodsShowBean.setPrice(price);
        goodsShowBean.setQuantity(quantity);
        goodsShowBean.setSpecId(specId);
        goodsShowBean.setId(id);
        goodsShowBean.setName(name);
        return goodsShowBean;
    }

    public GoodsShowBean() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeValue(this.specId);
        dest.writeString(this.name);
        dest.writeString(this.bottomName);
        dest.writeString(this.price);
        dest.writeString(this.imgUrl);
        dest.writeInt(this.quantity);
    }

    protected GoodsShowBean(Parcel in) {
        this.id = in.readInt();
        this.specId = (Integer) in.readValue(Integer.class.getClassLoader());
        this.name = in.readString();
        this.bottomName = in.readString();
        this.price = in.readString();
        this.imgUrl = in.readString();
        this.quantity = in.readInt();
    }

    public static final Creator<GoodsShowBean> CREATOR = new Creator<GoodsShowBean>() {
        @Override
        public GoodsShowBean createFromParcel(Parcel source) {
            return new GoodsShowBean(source);
        }

        @Override
        public GoodsShowBean[] newArray(int size) {
            return new GoodsShowBean[size];
        }
    };
}
